<?php

class MDB_QueryToolExt extends MDB_QueryTool {

    function __construct($dsn) {
        global $conexionDB;
        $this->sequenceName = $this->table;
        $this->tableSpec = array(
            array('name' => $this->table, 'shortName' => $this->table),
        );
        parent::__construct($dsn, array('autoConnect' => false), 1);

        if (!$conexionDB) {
            $this->connect($dsn);
            $conexionDB = $this->db;
        }
        else
            $this->db = $conexionDB;
    }

}

define('TABLA_INTERES', 'interes');
define('TABLA_PERSONA', 'persona');
define('TABLA_PRESTAMO', 'prestamo');
define('TABLA_APORTE', 'aporte');

class Interes extends MDB_QueryToolExt{
    var $table = TABLA_INTERES;
    var $primaryCol = 'idInteres';
}

class Persona extends MDB_QueryToolExt{
    var $table = TABLA_PERSONA;
    var $primaryCol = 'idPersona';
}

class Prestamo extends MDB_QueryToolExt {
    var $table = TABLA_PRESTAMO;
    var $primaryCol = 'idPrestamo';
}

class Aporte extends MDB_QueryToolExt {
    var $table = TABLA_APORTE;
    var $primaryCol = 'idAporte';
}

?>